package Exercise1;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class FileTest {
    public static void main(String args[])
    {
        FileReader fr = null;
        try {
            File file = new File("src\\Exercise.txt");
            fr = new FileReader(file);
            char cubf[] = new char[5];
            int len;
            while((len = fr.read(cubf))!=-1)
            {
                for(int i=0;i<len;i++)
                {
                    System.out.print(cubf[i]);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                fr.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
